﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;

namespace Sidvall.AuthorizationManager.UI.Wpf.Controls
{
	public partial class ButtonControl : UserControl
	{
		#region Public Members

		#region ButtonCommand

		public static readonly System.Windows.DependencyProperty ButtonCommandProperty = System.Windows.DependencyProperty.Register("ButtonCommand", typeof(ICommand), typeof(ButtonControl),
			new System.Windows.FrameworkPropertyMetadata(null, System.Windows.FrameworkPropertyMetadataOptions.None, null, null, false, System.Windows.Data.UpdateSourceTrigger.PropertyChanged));
		public ICommand ButtonCommand
		{
			get
			{
				return GetValue(ButtonCommandProperty) as ICommand;
			}
			set
			{
				SetValue(ButtonCommandProperty, value);
			}
		}

		#endregion
		#region ButtonCommandParameter

		public static readonly System.Windows.DependencyProperty ButtonCommandParameterProperty = System.Windows.DependencyProperty.Register("ButtonCommandParameter", typeof(object), typeof(ButtonControl),
			new System.Windows.FrameworkPropertyMetadata(null, System.Windows.FrameworkPropertyMetadataOptions.None, null, null, false, System.Windows.Data.UpdateSourceTrigger.PropertyChanged));
		public object ButtonCommandParameter
		{
			get
			{
				return GetValue(ButtonCommandParameterProperty);
			}
			set
			{
				SetValue(ButtonCommandParameterProperty, value);
			}
		}

		#endregion
		#region ButtonText

		public static readonly System.Windows.DependencyProperty ButtonTextProperty = System.Windows.DependencyProperty.Register("ButtonText", typeof(string), typeof(ButtonControl),
			new System.Windows.FrameworkPropertyMetadata(null, System.Windows.FrameworkPropertyMetadataOptions.None, null, null, false, System.Windows.Data.UpdateSourceTrigger.PropertyChanged));
		public string ButtonText
		{
			get
			{
				return GetValue(ButtonTextProperty) as string;
			}
			set
			{
				SetValue(ButtonTextProperty, value);
			}
		}

		#endregion
		#region ButtonMouseOverBackground

		public static readonly System.Windows.DependencyProperty ButtonMouseOverBackgroundProperty = System.Windows.DependencyProperty.Register("ButtonMouseOverBackground", typeof(Brush), typeof(ButtonControl),
			new System.Windows.FrameworkPropertyMetadata(SystemColors.InfoBrush, System.Windows.FrameworkPropertyMetadataOptions.None, null, null, false, System.Windows.Data.UpdateSourceTrigger.PropertyChanged));
		public Brush ButtonMouseOverBackground
		{
			get
			{
				return GetValue(ButtonMouseOverBackgroundProperty) as Brush;
			}
			set
			{
				SetValue(ButtonMouseOverBackgroundProperty, value);
			}
		}

		#endregion
		#region ImageSource

		public static readonly System.Windows.DependencyProperty ImageSourceProperty = System.Windows.DependencyProperty.Register("ImageSource", typeof(ImageSource), typeof(ButtonControl),
			new System.Windows.FrameworkPropertyMetadata(null, System.Windows.FrameworkPropertyMetadataOptions.None, null, null, false, System.Windows.Data.UpdateSourceTrigger.PropertyChanged));
		public ImageSource ImageSource
		{
			get
			{
				return GetValue(ImageSourceProperty) as ImageSource;
			}
			set
			{
				SetValue(ImageSourceProperty, value);
			}
		}

		#endregion
		#region ImageHeight

		public static readonly System.Windows.DependencyProperty ImageHeightProperty = System.Windows.DependencyProperty.Register("ImageHeight", typeof(double), typeof(ButtonControl),
			new System.Windows.FrameworkPropertyMetadata(24d, System.Windows.FrameworkPropertyMetadataOptions.None, null, null, false, System.Windows.Data.UpdateSourceTrigger.PropertyChanged));
		public double ImageHeight
		{
			get
			{
				return (double)GetValue(ImageHeightProperty);
			}
			set
			{
				SetValue(ImageHeightProperty, value);
			}
		}

		#endregion
		#region ImageWidth

		public static readonly System.Windows.DependencyProperty ImageWidthProperty = System.Windows.DependencyProperty.Register("ImageWidth", typeof(double), typeof(ButtonControl),
			new System.Windows.FrameworkPropertyMetadata(24d, System.Windows.FrameworkPropertyMetadataOptions.None, null, null, false, System.Windows.Data.UpdateSourceTrigger.PropertyChanged));
		public double ImageWidth
		{
			get
			{
				return (double)GetValue(ImageWidthProperty);
			}
			set
			{
				SetValue(ImageWidthProperty, value);
			}
		}

		#endregion
		#region ImageMargin

		public static readonly System.Windows.DependencyProperty ImageMarginProperty = System.Windows.DependencyProperty.Register("ImageMargin", typeof(Thickness), typeof(ButtonControl),
			new System.Windows.FrameworkPropertyMetadata(new Thickness(0), System.Windows.FrameworkPropertyMetadataOptions.None, null, null, false, System.Windows.Data.UpdateSourceTrigger.PropertyChanged));
		public Thickness ImageMargin
		{
			get
			{
				return (Thickness)GetValue(ImageMarginProperty);
			}
			set
			{
				SetValue(ImageMarginProperty, value);
			}
		}

		#endregion

		#endregion
		#region Constructors

		public ButtonControl()
		{
			InitializeComponent();
		}

		#endregion
	}
}
